<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    <!--定义Ajax-->
    var xmlHttpRequest = new XMLHttpRequest();
    //配置请求资源路径
    xmlHttpRequest.open("GET", "/ajax_war/servletA", true)
    //设置回调函数
    xmlHttpRequest.onreadystatechange=function (){
        if (xmlHttpRequest.readyState===4&&xmlHttpRequest.status===200){
            console.log(xmlHttpRequest.responseText)
            //var elementById = document.getElementById("search-input");
            //elementById.value = request.responseText;
        }
    }




    // 请求发送
    xmlHttpRequest.send()

</script>
</body>
</html>